<?php

namespace api\app\controller;

use api\app\model\BannerModel;
use cmf\controller\RestBaseController;
use think\facade\Db;
use think\facade\Filesystem;

class BannerController extends RestBaseController
{
    // 添加轮播图
    public function banner(){
        $list = Db::name("banner")->select();
        $this->success('轮播图显示',$list);
    }

    // 查询轮播图
    public function indexBanner()
    {
        $banner = BannerModel::select();
        if (empty($banner)){
            return error('查询失败');
        } else {
            return success('查询成功', $banner);
        }
    }
}